package design.observe;

/**
 * 观察者模式：
 * 何时使用：当一个对象状态改变，所有的依赖对象都将得到通知
 */
public class Client {
    public static void main(String[] args) {
        Observer observer1=new ZhangShanObserver();
        Observer observer2=new LiShiObserve();
        Subject teacher=new Teacher();
        teacher.registerOberser(observer1);
        teacher.registerOberser(observer2);
        teacher.notifyObservers();
    }
}
